﻿<Window x:Class="MTSGui.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Minecraft Topographical Survey" Width="760" Height="480" Icon="/mts-gui;component/Images/mts_logo.png"
        ResizeMode="CanResize" WindowStartupLocation="CenterScreen">
    <Window.TaskbarItemInfo>
        <TaskbarItemInfo />
    </Window.TaskbarItemInfo>
    <DockPanel Background="#ff444444">

        <Grid VerticalAlignment="Top" DockPanel.Dock="Top">
        
            <Menu VerticalAlignment="Top">
                <MenuItem Name="RenderMenu" Padding="4,4,4,5">
                    <MenuItem.Header>
                        <Grid>
                            <Image Source="/mts-gui;component/Images/World.png" Width="16" Height="16" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                            <TextBlock HorizontalAlignment="Left" Margin="18,0,2,0">Map World...</TextBlock>
                        </Grid>
                    </MenuItem.Header>

                    <MenuItem Name="RefreshMenu" Padding="5,4,4,5" Click="RefreshImage" Header="Refresh">
                        <MenuItem.Icon>
                            <Image Source="/mts-gui;component/Images/refresh.png" Width="16" Height="16" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <Separator />

                </MenuItem>

                <MenuItem Name="OptionsMenu" Padding="5,4,4,5" Click="ShowOptions">
                    <MenuItem.Header>
                        <Grid>
                            <Image Source="/mts-gui;component/Images/Images.png" Width="16" Height="16" HorizontalAlignment="Left" VerticalAlignment="Center" />
                            <TextBlock Name="MapTypeButton" HorizontalAlignment="Left" Margin="19,0,2,0">Output</TextBlock>
                        </Grid>
                    </MenuItem.Header>
                </MenuItem>
            
                <Separator Width="1" Margin="12,0,12,0" />
            
                <MenuItem Name="SaveMenu" Padding="6,4,4,5" Click="SaveImage">
                    <MenuItem.Header>
                        <Grid>
                            <Image Source="/mts-gui;component/Images/disk.png" Width="16" Height="16" HorizontalAlignment="Left" VerticalAlignment="Center" />
                            <TextBlock HorizontalAlignment="Left" Margin="20,0,2,0">Save image</TextBlock>
                        </Grid>
                    </MenuItem.Header>
                </MenuItem>

                <MenuItem Name="ViewMenu" Padding="6,4,4,5">
                    <MenuItem.Header>
                        <Grid>
                            <Image Source="/mts-gui;component/Images/wrench.png" Width="16" Height="16" HorizontalAlignment="Left" VerticalAlignment="Center" />
                            <TextBlock HorizontalAlignment="Left" Margin="20,0,2,0">Tools</TextBlock>
                        </Grid>
                    </MenuItem.Header>

                    <MenuItem Header="Upload to Internet" Click="PostImage">
                        <MenuItem.Icon>
                            <Image Source="/mts-gui;component/Images/Picture_go.png" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </MenuItem.Icon>
                    </MenuItem>
                    
                    <Separator />

                    <MenuItem Header="View in default program" Click="OpenImage">
                        <MenuItem.Icon>
                            <Image Source="/mts-gui;component/Images/Eye.png" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Copy image to clipboard" Click="CopyImage">
                        <MenuItem.Icon>
                            <Image Source="/mts-gui;component/Images/Clipboard.png" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </MenuItem.Icon>
                    </MenuItem>
                    
                    <Separator />
                    
                    <MenuItem Header="Copy MTS-CLI command" Click="CreateScript">
                        <MenuItem.Icon>
                            <Image Source="/mts-gui;component/Images/CMD.png" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>

                <Separator Width="1" Margin="12,0,12,0" />
                
                <MenuItem Name="HelpMenu" Padding="6,4,4,5">
                    <MenuItem.Header>
                        <Grid>
                            <Image Source="/mts-gui;component/Images/Help.png" Width="16" Height="16" HorizontalAlignment="Left" VerticalAlignment="Center" />
                            <TextBlock HorizontalAlignment="Left" Margin="20,0,2,0">Help</TextBlock>
                        </Grid>
                    </MenuItem.Header>
                    <MenuItem.Items>
                        <MenuItem Header="MTS Basics" Tag="http://minecraft.codeplex.com/wikipage?title=MTS" Click="MenuLink">
                            <MenuItem.Icon>
                                <Image Source="/mts-gui;component/Images/Book_open.png" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" />
                            </MenuItem.Icon>
                        </MenuItem>
                        <Separator />
                        <MenuItem Header="Project website" Tag="http://minecraft.codeplex.com/" Click="MenuLink">
                            <MenuItem.Icon>
                                <Image Source="/mts-gui;component/Images/House.png" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" />
                            </MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="Report bugs" Tag="http://minecraft.codeplex.com/workitem/list/basic" Click="MenuLink">
                            <MenuItem.Icon>
                                <Image Source="/mts-gui;component/Images/Bug.png" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" />
                            </MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="About MTS" Click="ShowAbout">
                            <MenuItem.Icon>
                                <Image Source="/mts-gui;component/Images/Information.png" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" />
                            </MenuItem.Icon>
                        </MenuItem>
                        <Separator />
                        <MenuItem Header="Send Anonymous Stats" IsCheckable="True" IsChecked="True" Name="StatsToggle" Click="ToggleStats" />
                    </MenuItem.Items>
                </MenuItem>
            </Menu>

        </Grid>

        <Grid>
            
            
            <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0">
                <Grid.Background>
                    <!--<ImageBrush TileMode="Tile" Viewbox="0, 0, 64, 64" ViewboxUnits="Absolute" Viewport="0, 0, 64, 64" ViewportUnits="Absolute" ImageSource="/mts-gui;component/Images/UI/Background.png"/>
                    -->
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="Black" Offset="0"/>
                        <GradientStop Color="#FF333355" Offset="1"/>
                    </LinearGradientBrush>
                </Grid.Background>

                <ScrollViewer Name="scrollTerrain" HorizontalScrollBarVisibility="Auto"  VerticalScrollBarVisibility="Auto" PanningMode="Both" 
                              PreviewMouseDown="scrollTerrain_PreviewMouseDown" PreviewMouseMove="scrollTerrain_PreviewMouseMove" 
                              PreviewMouseUp="scrollTerrain_PreviewMouseUp">
                    <Image Name="imageTerrain" Stretch="None" />
                </ScrollViewer>
            </Grid>

            <Grid Background="#ff222222" Name="RenderInfo" Visibility="Visible" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Opacity=".9" Margin="0,0,0,0">
                <Image Source="/mts-gui;component/Images/time.png" Width="16" Height="16" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="6,0,0,0" />
                <TextBlock Name="RenderInfoText" FontSize="14" Margin="0,0,0,0" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Bottom" Padding="28,4,4,4">
                    Wait a moment...</TextBlock>
            </Grid>
        </Grid>

    </DockPanel>
</Window>
